package com.hourses.mapper;

import com.hourses.page.Page;
import com.hourses.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    //根据user_code查询用户
    public User selectByCode(String code);

    //查询满足查询条件的用户列表总行数
    public Integer selectTotalUser(User user);

    //查询满足查询条件的用户集合
    public List<User> selectUserListByPage(@Param("user") User user, @Param("page") Page page);

    //增加用户
    public Integer insertUser(User user);

    //启用或者禁用用户
    public Integer updateUserState(String userState,Integer userId);

    //根据用户id删除一个或者多个用户
    public Integer updateIsdeleteByUserIds(List<Integer> userIds);

    //修改用户信息(姓名)
    public Integer updateUserNameByUserId(@Param("user") User user);

    //重置用户密码
    public Integer resetPwd(@Param("userId") Integer userId,@Param("newPwd") String newPwd);

}
